package karma.main;

import net.minecraft.client.Minecraft;
import net.minecraft.src.*;
import net.minecraft.src.forge.*;

public class ItemHolyHelm extends ItemArmor implements ISpecialArmor
{
	public static boolean worn;
    public ItemHolyHelm(int i, EnumArmorMaterial enumarmormaterial, int j, int k)
    {
        super(i, enumarmormaterial, j, k);
    }
    /**
     * Return an item rarity from EnumRarity
     */
    public EnumRarity getRarity(ItemStack itemstack)
    {
        return mod_KarmaCraft.ENCHANTED;
    }
    public static void checkIfWorn(Minecraft minecraft)
    {
        if (minecraft.thePlayer.inventory.armorInventory[3] != null && minecraft.thePlayer.inventory.armorInventory[3].getItem() == mod_KarmaCraft.HolyHelm)
        {
        	worn = true;
        	doSpecial(minecraft);
        }
    }
    
    public static void doSpecial(Minecraft mc)
    {
    	mc.thePlayer.removePotionEffect(Potion.poison.id);
    }
    
	@Override
	public ArmorProperties getProperties(EntityLiving player, ItemStack armor,
			DamageSource source, double damage, int slot) {

		double d;
		if (source == DamageSource.magic)
		{
			d = 1;
			armor.damageItem(2, player);
		}
		else
		{
			d = 0;
		}
		return new ArmorProperties(0, d, Integer.MAX_VALUE);
	}
	@Override
	public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public void damageArmor(EntityLiving entity, ItemStack stack,
			DamageSource source, int damage, int slot) {
		// TODO Auto-generated method stub
		
	}
}
